package com.rj.data.job;

import com.rj.data.entity.Job;

public abstract class SingleThreadJob extends Job<Boolean> {

    @Override
    public Boolean execute() {
        if (tasks == null || tasks.size() <= 0) {
            return false;
        }
        tasks.forEach(task -> {
            try {
                task.runTask();
            } catch (Exception e) {
                throw new RuntimeException("启动任务失败", e);
            }
        });
        return true;
    }
}
